﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace PokerTimer
{
	public partial class CurrentBlindsControl : UserControl
	{
        public List<Blind> LiveBlindsList {get; set;}
        public int selectedBlind = 0;

		public CurrentBlindsControl()
		{
			// Required to initialize variables
			InitializeComponent();
		}

        public void RefreshBlindValues()
        {
            bigAmount.DataContext = LiveBlindsList[selectedBlind].Big;
            smallAmount.DataContext = LiveBlindsList[selectedBlind].Small;
        }

        public bool IncrementBlinds()
        {
            if (selectedBlind < (LiveBlindsList.Count - 1))
            {
                selectedBlind++;
                RefreshBlindValues();
                return true;
            }
            else return false;
        }

        public bool DecrementBlinds()
        {
            if (selectedBlind > 0)
            {
                selectedBlind--;
                RefreshBlindValues();
                return true;
            }
            else return false;
        }

        private void NextBtn_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
		{
            IncrementBlinds();
		}

		private void PreviousBtn_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
		{
            DecrementBlinds();
        }

	}
}